#include <stdio.h>
#include <stdlib.h>

#if 1
int main()
{
    int i;
    printf("50000\n");
    for (i = 0; i < 50000; i++)
    {
        printf("aaaaa\n");
    }
    return 0;
}

#elif 0

#define MIN_N   1
#define MAX_N   50000  /* 50000 */
#define CASES   100

int gen_int(int Min, int Max)
{
    return Min + rand() % (Max-Min+1);
}

int main()
{
    const char *charset = 
        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    int t;
    for (t = 0; t < CASES; t++)
    {
        int i, j, n = gen_int(MIN_N, MAX_N);
        printf("%d\n", n);
        for (i = 0; i < n; i++)
        {
            char line[6];
            for (j = 0; j < 5; j++)
                line[j] = charset[gen_int(0, 61)];
            line[j] = '\0';
            printf("%s\n", line);
        }
        printf("\n");
    }
    return 0;
}

#else

static char lines[50000][6];

int brute_force()
{
    int n, i, j, k;
    int share[6] = { 0 };

    if (!(scanf("%d", &n) == 1 && n > 0))
        return 0;
    
    for (i = 0; i < n; i++)
        scanf("%s", lines[i]);

    for (i = 0; i < n; i++)
    {
        for (j = i + 1; j < n; j++)
        {
            int count = 0;
            for (k = 0; k < 5; k++)
                if (lines[i][k] == lines[j][k])
                    ++count;
            share[count]++;
        }
    }
    for (k = 5; k >= 0; k--)
        printf("%d ", share[k]);
    printf("\n");

    return 1;
}

int main()
{
    while (brute_force());
    return 0;
}
#endif